var xmlhttp

function showCustomer(str)
{
    xmlhttp=new XMLHttpRequest();

    var url="http://cascade.fnal.gov:9998/jersey/xpathsearch";
    xmlhttp.onreadystatechange=stateChanged;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

function stateChanged()
{
    if (xmlhttp.readyState==4)
    {
        var xmlDoc=xmlhttp.responseXML.documentElement;
        document.getElementById("companyname").innerHTML=
        xmlDoc.getElementsByTagName("compname")[0].childNodes[0].nodeValue;
        document.getElementById("contactname").innerHTML=
        xmlDoc.getElementsByTagName("contname")[0].childNodes[0].nodeValue;
        document.getElementById("address").innerHTML=
        xmlDoc.getElementsByTagName("address")[0].childNodes[0].nodeValue;
        document.getElementById("city").innerHTML=
        xmlDoc.getElementsByTagName("city")[0].childNodes[0].nodeValue;
        document.getElementById("country").innerHTML=
        xmlDoc.getElementsByTagName("country")[0].childNodes[0].nodeValue;
    }
}